#pragma once
#include "EpilStatementCodeBase.h"
#include "EpilThenBlockCode.h"
#include "EpilChunkCode.h"


class EpilIfStatementCode : public EpilStatementCodeBase
{
	EPIL_CODE_DECL( IfStatement );

public:
	EpilIfStatementCode( const EpilLexLocation & location );
	virtual ~EpilIfStatementCode();

	EpilThenBlockCode *					GetIfBlock() const											{ return m_ifBlock; }
	void								SetIfBlock( EpilThenBlockCode * ifBlock )					{ m_ifBlock = ifBlock; }
	EpilThenBlockCodeList &				GetElseIfBlocks()											{ return m_elseifBlocks; }
	const EpilThenBlockCodeList &		GetElseIfBlocks() const										{ return m_elseifBlocks; }
	void								SetElseIfBlocks( const EpilThenBlockCodeList & blocks )		{ m_elseifBlocks = blocks; }
	EpilChunkCode *						GetElseBlock() const										{ return m_elseBlock; }
	void								SetElseBlock( EpilChunkCode * elseBlock )					{ m_elseBlock = elseBlock; }

	virtual tstring						ToEpilCode( int indent ) const;

private:
	EpilThenBlockCode *					m_ifBlock;
	EpilThenBlockCodeList				m_elseifBlocks;
	EpilChunkCode *						m_elseBlock;
};